package com.tanhua.manage.controller;

import com.tanhua.manage.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    /**
     * 接口名称：新增、活跃用户、次日留存率
     * 接口路径：GET/dashboard/users
     */
    @GetMapping("/users")
    public ResponseEntity<Object> dashboard(String sd,String ed,Integer type) throws ParseException {
        return dashboardService.dashboard(Long.parseLong(sd),Long.parseLong(ed),type);
    }
}
